/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package bikeapp;

/**
 *
 * @author junliu
 */
public class BikeApp implements BikeInterface {

    
    static int speed = 20;
    static String warning;
    
    public void printMsg(){
        System.out.println("Interface Implemented");
        
    }
    
    /**
     * 
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // Create object of bike class
        Bike redBike = new Bike();
        Bike blueBike = new Bike();
        
        //Array Initialisation
        int[] anArray;
        
        //Allocating memory for array
        anArray = new int[10];
        
        //Array value Initialisation
        anArray[0] = 1;
        anArray[1] = 2;
        anArray[2] = 3;
        anArray[3] = 4;
        anArray[4] = 5;
        anArray[5] = 6;
        anArray[6] = 7;
        anArray[7] = 8;
        anArray[8] = 9;
        anArray[9] = 10;
        
        //for loop
        
       // for(int i = 0; i < anArray.length; i++){
        //   anArray[i] = i*3;
       // }
         
        for(int i = 0; i < anArray.length; i++){
            System.out.println(+anArray[i]);
        }
        
        
        
        //interface test
        BikeApp iBike = new BikeApp();
        
        iBike.printMsg();
        
        //Road bike subclass object instance
        RoadBike redRoadBike = new RoadBike();
        
        
        // Invoke methods on objects
        redBike.changeCadence(30);
        redBike.changeGear(5);
        redBike.speedUp(100);
        redBike.printStats();
        
        
        blueBike.speedDown(10);
        blueBike.printStats();
       
        
        redRoadBike.speedUp(100);
        redRoadBike.printStats();
        
        
        if (speed < 50){                    //If....
            warning = "SLOW SPEED";         //Then...
        }   else {                          //Else /          
            warning = "HIGH SPEED";
                    }
        System.out.println(warning);
        
        
        int month = 2;
        String monthString;
        
        switch (month){
            case 1: monthString = "Jan";
                    break;
            case 2: monthString = "Feb";     
                    break;
            default: monthString = "Invalid";    
            
        }
        
        System.out.println(monthString);
        
        
        //System.out.println("Array Index number 0 has value:" +anArray[0]);
    }
}
